#ifndef SMGLOBAL_H
#define SMGLOBAL_H

#include <Qt>

class QDataStream;
class QDebug;
class ResultError;

namespace SmGlobal
{
    enum SectionType
    {
        UnknownSection,
        ContractorSection,
        OrderItemSection,
        OrderSection,
        ProductInWarehouseSection,
        ProductSection,
        ServerSection,
        WarehouseSection,
        WorkerSection
    };

    enum GeneralError
    {
        NoGeneralError,
        UnknownDatabaseError,
        DataInvalidError
    };

    enum CellsRange
    {
        AllCells,
        SelectedCells
    };

    enum ColumnsVisibility
    {
        AllColumns,
        VisibleColumns,
        HiddenColumns
    };

    // note that HierarchicalHeaderView already occupies Qt::UserRole and Qt::UserRole+1
    enum DataRole
    {
        SectionTypeRole = Qt::UserRole+2,
        LeafCountRole,
        VisibleLeafCountRole
    };

    enum HeaderSectionType
    {
        SingleSection,
        MultipleSection
    };
}

QDataStream& operator>> (QDataStream& stream, ResultError& error);
QDataStream& operator<< (QDataStream& stream, const ResultError& error);

#endif // SMGLOBAL_H
